// Copyright (C) 1995
// Use is governed by the MiscKit license

#import "MiscColorViewInspector.h"
#import <misckit/MiscColorView.h>

@implementation MiscColorViewInspector

// Load the Inspector

- init
{
    char		buf[MAXPATHLEN + 1];
    id		bundle;
    
    [super init];
    
    bundle = [NXBundle bundleForClass:[MiscColorView class]];

    if( [bundle getPath:buf forResource:"MiscColorViewInspector" 
							ofType:"nib"] )
		[NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];

    return self;
}

// Query the object for it's attributes

- revert:sender
{
	[backgroundColorWell setColor:[object backgroundColor]];
	[desktopcolorSwitch setState:[object hasSameColorAsDesktop]];

	return [super revert:sender];
}

- colorChanged:sender
{
	[object setBackgroundColor:[sender color]];
    return [super ok:sender];
}

- desktopcolorUseChanged:sender
{
	[object setUseSameColorAsDesktop:[desktopcolorSwitch state]];
	return [super ok:sender];
}

- (BOOL)wantsButtons
{
	return NO;
}

@end
